-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor trie package a bit #171
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
trie/rlphacks/bytes.go
Outdated
@@ -37,7 +39,7 @@ func (b RlpEncodedBytes) DoubleRLPLen() int { | |||
|
|||
func encodeBytesAsRlpToWriter(source []byte, w io.Writer, prefixGenFunc func([]byte, int, int) int, prefixBufferSize uint) error { | |||
// > 1 byte, write a prefix or prefixes first | |||
if len(source) > 1 || (len(source) == 1 && source[0] >= 0x80) { | |||
if len(source) > 1 || (len(source) == 1 && source[0] >= rlp.EmptyStringCode) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Strictly speaking, in this particular case, 0x80 is not used as the encoding of the empty string. It is another constant of the RLP algorithm, which happens to be the same value as the encoding of the empty string.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is related though, otherwise how would they know if that is a prefix or not, so I understand why it is there :) But I can add a comment about that too.
* Delete code with account, add code test * Fix test Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
* save l1Blockhash separately * add l1blockhash and ger to block info treeon injected batches * fixed a bug on delete
fixes #129